<div class="Main_Right" >
	<div class="Main_Right_Top">
		<span></span>
	</div>
	<div class="Main_Right_Content" id="Main_Right_Content">
		<div class="Main_Right_Title">
			当前位置：用户管理 --> 用户列表
		</div>
		<div class="Main_handleBar check_pass" id="Main_handleBar" style="display: none">
			<div class="Main_handleBar_head"></div>
			<div class="Main_handleBar_body">
				<p></p>
			</div>
		</div>
		<div class="Main_handleBar check_pass" id="Main_handleBar" style="display: none">
			<div class="Main_handleBar_head"></div>
			<div class="Main_handleBar_body">
				<p></p>
			</div>
		</div>
		<div class="ToolBar">
			<div class="frame-main-cont-head" >
				<div class="js-component-toolbar nui-toolbar " >
					<div class="nui-toolbar-item">
						<div  role="button" tabindex="0" class="js-component-button nui-mainBtn nui-btn nui-btn-hasIcon nui-mainBtn-hasIcon">
							<span  class="nui-btn-icon">
								<b class="js-component-icon nui-ico nui-ico-plus" style="background-image: url(${displayStaticLocation?default("")}admin/image/whiteplus.png);background-position:top;background-repeat:no-repeat">&nbsp;&nbsp;</b>
							</span>
							<span class="nui-btn-text" onclick="inserNew('${base}/user/toadd.action')">新增用户</span>
						</div>
					</div>
					<div class="nui-toolbar-item">
						用户名：
						<input  type="text" id="userName" name="userName" value='${userName!""}'>
					</div>
					<div class="nui-toolbar-item">
						<div style="float:right;" role="button" tabindex="0" class="js-component-button nui-mainBtn nui-btn ">
							<span style="border-radius:3px"   class="nui-btn-text" onclick="toSubmit();" >搜索</span>
						</div>
					</div>
				</div>
			</div>
		</div>
		<form name="searchForm" id="searchForm" action="/tyloo_sh_new/item/actions.html?method=list&type=1" method="post" >
		<!-- Main_information end -->
		<div class="Main_Right_ListTable">
			<div class="Main_Right_SearchTable_Title" style="display:None">
				<span class="Main_Right_SearchTable_Title_Left"></span>
				用户管理 <span class="Main_Right_SearchTable_Title_Right"></span>
			</div>
			<table   width="100%" >
				<thead class="nui-table-head" >
					<tr class="nui-table-row">
						<th width="20%" class="nui-table-cell">用户名</th>
						<th width="15%" class="nui-table-cell">真实姓名</th>
						<th width="20%" class="nui-table-cell">邮箱</th>
						<th width="5%" class="nui-table-cell">性别</th>
						<th width="20%" class="nui-table-cell">联系电话</th>
						<th width="20%" class="nui-table-cell">操作</th>
					</tr>
				</thead>
	            <#assign count=0 />   
	            <#if userList?exists>
	            	<#assign count=userList.size() />   
		            <#list userList as obj>
		            <tr class="odd" onmouseover="this.className='even'" onmouseout="this.className='odd'">
		              <td class="nui-table-cell">${(obj.userName)?if_exists}</td>
		              <td class="nui-table-cell">${(obj.realName)?if_exists}</td>
		              <td class="nui-table-cell">${obj.email?if_exists}</td>
		              <td class="nui-table-cell">
		                <@baseMacro.showSex obj.sex!-1 />
		              </td>
		              <td class="nui-table-cell">${(obj.contactPhone)?if_exists}</td>
		              <td class="nui-table-cell">
		              	<a onclick="viewDetail('${base}/user/toview.action?objId=${(obj.id)}')" href="#">查看</a>
		              	<a onclick="viewUpdate('${base}/user/toedit.action?objId=${(obj.id)}')" href="#">编辑</a>
		              	<a onclick="viewUpdate('${base}/user/toviewactions.action?objId=${(obj.id)}')" href="#">查看足迹</a>
		              	<a onclick="dele('${obj.id}','${base}/user/del.action','${base}/user/list.action')" href='####'">删除</a>
		              </td>
		            </tr>
		            </#list>
		        </#if>
    	        <#if (pageSize - count - 1) &gt; 0>
			        <#list 0..(pageSize - count - 1) as i>
		            <tr class="odd" onmouseover="this.className='even'" onmouseout="this.className='odd'">
		              <td>&nbsp;</td>
		              <td>&nbsp;</td>
		              <td>&nbsp;</td>
		              <td>&nbsp;</td>
		              <td>&nbsp;</td>
		              <td>&nbsp;</td>
		              </tr>
		           </#list>
           		</#if>
			</table>
			<div class="ToolFooter" style="margin-top:-1px;">
      			<@pageMacro.showPage page/>
      		</div>
      		<script language = 'JavaScript'>
		       function changePage(cpage){
			        var theurl='${base}/user/list.action?currentPage='+cpage;
			        $("#home_panel").load(theurl);
		       }
		    </script>  
		</div>
		</form>
	</div>
</div>
<script type="text/javascript">
function dele(id,urlGet,urlLoad) {
  jQuery( "#dialog:ui-dialog" ).dialog( "destroy" );
  jQuery( "#dialog-confirm" ).dialog({
            show: "slide",
			hide: "fade",
			resizable: false,
			height:150,
			modal: true,
			buttons: {
				"确定": function() {
				    $( this ).dialog( "close" );
				    jQuery.get(urlGet, {objId:id},function(){
				     	$("#home_panel").load( urlLoad);
 				    });
				},
				取消: function() {
					$( this ).dialog( "close" );
				}
			}
		});
}

	jQuery(document).ready(function($) {
		 	$( "#starDate" ).datepicker();
			$( "#starDate" ).datepicker( "option", "dateFormat",'yy-mm-dd' );
			$( "#endDate" ).datepicker();
			$( "#endDate" ).datepicker( "option", "dateFormat",'yy-mm-dd' );
 
	});
function toSubmit(){ 
		var  userName=$("#userName").val();
		 $("#home_panel").load("${base}/user/list.action",{"userName":userName});		
}
</script>

